﻿@using Peresvet.Common.Constants
@model IEnumerable<Peresvet.Models.NewsItemModel>
@{
	ViewBag.Title = "ПВПК \"Пересвет\"";
}

@if (Model != null && Model.Any())
{
	<div>
		@for (var index = 0; index < Model.Count(); index++)
		{
			<div class="news" @Html.Raw(index % 2 == 0 ? "id='odd'" : "id='even'")>
				<h3>
					@(!string.IsNullOrWhiteSpace(Model.ElementAt(index).ShortHeader)
						? Model.ElementAt(index).ShortHeader
						: string.Empty)
				</h3>
				<a href="@(Url.Action<HomeController>(m => m.News(Model.ElementAt(index).NewsId)))">
					<img src="../../@(!string.IsNullOrWhiteSpace(Model.ElementAt(index).ThumbImageUrl)
						                  ? Model.ElementAt(index).ThumbImageUrl
						                  : ApplicationSettings.DEFAULT_NEWS_THUMB_IMAGE_URL)" alt="" />
					<div class="info-news-proba">
						<p>
							@(!string.IsNullOrWhiteSpace(Model.ElementAt(index).ShortDescription)
								? Model.ElementAt(index).ShortDescription
								: string.Empty)
						</p>
					</div>
				</a>
			</div>
		}
	</div>
}